#!/bin/bash

export dockerVersion=20.10.9-3.el7
yum -y install docker-ce-$dockerVersion docker-ce-cli-$dockerVersion containerd.io

mkdir -p /etc/docker

echo '{"log-driver": "json-file","log-opts": {"max-size": "10m","max-file": "10"},"registry-mirrors": ["http://hub-mirror.c.163.com","https://p4j5yg6k.mirror.aliyuncs.com"]}' >> /etc/docker/daemon.json

systemctl start docker

systemctl enable docker

curl https://gitee.com/yuninglong/linux/raw/master/centos/centos_alias_docker.sh -o $basepath/centos_alias_docker.sh
cat $basepath/centos_alias_docker.sh >> /etc/bashrc
source /etc/bashrc


#sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
##由于github国内访问问题，需要先下载后再处理
##wget https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64
#cp docker-compose-linux-x86_64 /usr/local/bin/docker-compose
##chmod +x /usr/local/bin/docker-compose
##ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
##docker-compose --version

